package eceptionDemo;

class SomeClass 
{
    private int age;

    public void setAge(int age) {
        this.age = age;
    }
    boolean checkAge() throws MyException
    {
        boolean res=true;
        if(age<0) throw new MyException("Age is Nagetive Number!");
        if(age>200) throw new MyException("Age Number is too big for mankind!");
        return res;
    }

    @Override
    public String toString() {
        return "SomeClass{" + "age=" + age + '}';
    }
    
} 
